unit detalleMaterialCompra;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Provider, SqlExpr, DB, DBClient, DBLocal, DBLocalS, Grids,
  DBGrids, RXDBCtrl;

type
  TfrmDetalleMaterialCompra = class(TForm)
    RxDBGrid1: TRxDBGrid;
    cds: TSQLClientDataSet;
    s: TDataSource;
    cdsNUMERO: TIntegerField;
    cdsFECHA: TSQLTimeStampField;
    cdsIVA: TFloatField;
    cdsDESCUENTO: TFloatField;
    cdsCANTIDAD: TFloatField;
    cdsSUBTOTAL: TFloatField;
    cdsTOTAL: TFloatField;
    cdsDENOMINACION: TStringField;
    cdsUNI: TFloatField;
    procedure RxDBGrid1TitleClick(Column: TColumn);
  private
  public
    constructor CreateNuevo(AOwner: TComponent; ini, fin, material, proveedor: string;
    id: integer);
  end;

var
  frmDetalleMaterialCompra: TfrmDetalleMaterialCompra;

implementation

uses MDatos;

{$R *.dfm}

{ TfrmDetalleMaterialCompra }

constructor TfrmDetalleMaterialCompra.CreateNuevo(AOwner: TComponent; ini,
  fin, material, proveedor: string; id: integer);
begin
  inherited Create(Aowner);
  self.Caption := 'Detalle de compra de: '+proveedor+'-'+material;
  self.cds.Params [0].AsInteger := id;
  self.cds.Params [1].AsString := ini;
  self.cds.Params [2].AsString := fin;
  self.cds.Open;
  self.ShowModal;
end;

procedure TfrmDetalleMaterialCompra.RxDBGrid1TitleClick(Column: TColumn);
begin
  self.cds.IndexFieldNames := Column.FieldName;
end;

end.
